import request from "@/config/axios";

// 请求数据
export const userTableData = (data)=>request(
    {
        url:`http://localhost:8080/jeecg-boot/sys/user/list?&pageNo=${data.pageNo}&pageSize=${data.pageSize}&username=*${data.username}*&sex=${data.sex}&realname=*${data.realname}*&phone=${data.phone}&status=${data.status}&superQueryMatchType={data.superQueryMatchType}`,//请求的地址
        method:"GET"
    }
)

// 增加数据
export const addData=(data)=>request(
    {
        url:`http://localhost:8080/jeecg-boot/sys/user/add`,
        method:'POST',
        data
    }
)
//删除数据
export const delData=(id)=>request(
    {
        url:`http://localhost:8080/jeecg-boot/sys/user/delete?id=${id}`,
        method:'DELETE',
        
    }
)


// 请求抽屉， 弹框数据
export const mesTableData = (data)=>request(
    {
        url:`http://localhost:8080/jeecg-boot/sys/position/list?pageNo=${data.pageNo}&pageSize=${data.pageSize}`,//请求的地址
        method:"GET"
    }
)


// 导出excel
export const excelExport = (data)=>request(
    {
        url:`http://localhost:8080/jeecg-boot/sys/user/exportXls?pageNo=${data.pageNo}&pageSize=${data.pageSize}`,//请求的地址
        method:"GET",
        responseType: 'blob'
    }
)


// 上传照片
export const uploadimage = (data ,params) =>request({
    url:`http://localhost:8080/jeecg-boot/sys/common/upload`,
    method:"POST",
    data,//表单数据 （图片）
    params//携带参数
})




// 回收站数据
export const trashTabledata = ()=>request(
    {
        url:`http://localhost:8080/jeecg-boot/sys/user/recycleBin`,//请求的地址
        method:"GET",
        
    }
)

// 回收站数据返回
export const trashDataBack = (data)=>request(
    {
        url:`http://localhost:8080/jeecg-boot/sys/user/putRecycleBin`,//请求的地址
        method:"PUT",
        data
        
    }
)

// 回收站彻底删除
export const trashDataDel = (data)=>request(
    {
        url:`http://localhost:8080/jeecg-boot/sys/user/deleteRecycleBin?userIds=${data.userIds}`,//请求的地址
        method:"DELETE",
        
        
    }
)

// 下拉框

export const optionData = ()=>request(
    {
        url:`http://localhost:8080/jeecg-boot/sys/role/queryall`,//请求的地址
        method:"GET",
        
        
    }
)

